#include "apiresources.h"
#include "../include/api/apiinfo.h"
#include <QString>

std::string ApiResources::getUrl(const std::string& name)
{
	if (!name.empty())
	{
		QString url = QString::fromStdString(name).replace("_", "/");
		if (!url.startsWith("/"))
		{
			url = QString("/").append(url);
		}

		return ApiInfo::getRootUrl().append(url.toStdString());
	}

	return ApiInfo::getRootUrl();
}